package com.dongjiantong.common.utils;

/**
 * Created by ThinkPad on 2017/11/30.
 */
public class FarmAreaUtil {

    public static String getArea(Integer ProvinceId, Integer cityID, Integer regionID, Integer streetId, Integer villageId) {

        //市
        String city = cityID.toString();
        switch (city.length()) {
            case 1:
                city = "0" + city;
                break;
        }

        //县
        String region = regionID.toString();
        switch (region.length()) {
            case 1:
                region = "0" + region;
                break;
        }

        // 镇
        String street = streetId.toString();
        switch (street.length()) {
            case 1:
                street = "00" + street;
                break;
            case 2:
                street = "0" + street;
                break;
        }

        //村
        String village = villageId.toString();

        switch (village.length()) {
            case 1:
                village = "00" + village;
                break;
            case 2:
                village = "0" + village;
                break;
        }
        String area =ProvinceId.toString()
                + cityID
                + regionID
                + streetId
                + villageId;

        return area;
    }

}
